package com.yunhe.mybatis.web.pay;

import com.yunhe.mybatis.service.MeetService;
import com.yunhe.mybatis.service.PayService;
import com.yunhe.mybatis.service.impl.MeetServiceImpl;
import com.yunhe.mybatis.service.impl.PayServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/pay/delete")
public class DeleteServlet extends HttpServlet {
    private PayService payService = new PayServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        Integer payId = Integer.valueOf(req.getParameter("payId"));
        payService.remove(payId);
        req.getRequestDispatcher("/success.jsp").forward(req, resp);
    }

}
